<%@ include file="/common/taglibs.jsp"%>

<title><fmt:message key="personList.title"/></title>
<content tag="heading"><fmt:message key="personList.heading"/></content>
<meta name="menu" content="PersonMenu"/>

<display:table name="personList" cellspacing="0" cellpadding="0" requestURI=""
    id="personList" class="table personList" export="true">
	<display:column titleKey="person.personId" sortable="true" sortProperty="personId">
         <c:choose>
         <c:when test="${personList.primary eq null}">
         	<c:set var="editurl" value="editPerson.html?personId=${personList.personId}"/>
         </c:when>
         <c:otherwise>
         	<c:set var="editurl" value="editRelationship.html?primaryPersonId=${personList.primary.personId}&personId=${personList.personId}"/>
         </c:otherwise>
         </c:choose>
         <a href="${editurl}">${personList.personId}</a>
	</display:column>
    <display:column property="firstName" escapeXml="true" sortable="true"
         titleKey="person.firstName"/>
    <display:column property="lastName" escapeXml="true" sortable="true"
         titleKey="person.lastName"/>
    <display:column property="dateOfBirth" escapeXml="true" sortable="true"
         titleKey="person.dateOfBirth"/>
    <display:column property="gender" escapeXml="true" sortable="true"
         titleKey="person.gender"/>
    <display:column property="roles" escapeXml="true" sortable="true"
         titleKey="person.roles"/>
    <display:column property="totalFees" escapeXml="true" sortable="true"
         title="Total Fees"/>
    <display:column property="numberOfStudents" escapeXml="true" sortable="true"
         title="Total Siblings"/>
    <display:column property="feesPaid" escapeXml="true" sortable="true"
         title="Feed Paid"/>
    <display:column property="booksPaid" escapeXml="true" sortable="true"
         title="Books Paid"/>
    <display:column property="lunchPaid" escapeXml="true" sortable="true"
         title="Lunch Paid"/>
    <display:column property="parentNotes" escapeXml="true" sortable="true"
         title="Notes"/>
    <display:setProperty name="paging.banner.item_name" value="person"/>
    <display:setProperty name="paging.banner.items_name" value="persons"/>
</display:table>

<script type="text/javascript">
    highlightTableRows("personList");
</script>
